package com.zzyl.enums;

public enum FlowStatus{
    APPLY(0, "入住申请", "养老顾问","发起申请-申请入住") {
        @Override
        public String[] doGetStep() {
            return new String[0];
        }
    },
    REVIEW(1, "入住评估", "护理组主管","护理主管处理-入住评估") {
        @Override
        public String[] doGetStep() {
            return new String[]{FlowStatus.APPLY.stepDesc, FlowStatus.REVIEW.stepDesc};
        }
    },
    APPROVAL(2, "入住审核", "院长","院长处理-入住审批") {
        @Override
        public String[] doGetStep() {
            return new String[]{FlowStatus.REVIEW.stepDesc, FlowStatus.APPROVAL.stepDesc};
        }
    },
    CONFIG(3, "入住配置", "养老顾问","养老处理-入住配置") {
        @Override
        public String[] doGetStep() {
            return new String[]{FlowStatus.APPROVAL.stepDesc, FlowStatus.CONFIG.stepDesc};
        }
    },
    SIGN(4, "签约办理", "法务","法务处理-签约办理") {
        @Override
        public String[] doGetStep() {
            return new String[]{FlowStatus.CONFIG.stepDesc, FlowStatus.SIGN.stepDesc};
        }
    };

        Integer code;
        String name;
        String role;
        String stepDesc ;

        FlowStatus(Integer code, String name, String role,String stepDesc ){
            this.code = code;
            this.name = name;
            this.role = role;
            this.stepDesc  = stepDesc ;
        }
        public Integer getCode(){
            return this.code;
        }

        public String getName(){
            return this.name;
        }

        public String getRole(){
            return this.role;
        }

    public static String[] getSteps(int flowCode){
        FlowStatus[] values = FlowStatus.values();
        for (FlowStatus value : values) {
            if(value.getCode() == flowCode){
                String[] steps = value.doGetStep();
                return steps;
            }
        }
        return null;
    }


    public abstract String[] doGetStep();


    }
